<include file="Public:header" /> <include file="Public:leftside" />
<div class="main-content">
    <div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
        <ul class="breadcrumb">
            <li> <i class="icon-home home-icon"></i> <a href="/">首页</a> </li>
          
            <li class="active">商品分类管理</li>
        </ul>
    </div>
    <div class="page-content">
    <div class="row panel-body" style="width: 100%;margin: 5px auto;padding: 15px 0;">
        <a href="{:U('Shop/index')}" class="btn btn-sm btn-default">商品管理</a>
        <a href="{:U('Shop/ticketTypeList')}" class="btn btn-sm btn-primary">商品分类</a>
        <a href="{:U('Shop/brandList')}" class="btn btn-sm btn-default">商品品牌</a>
        <a href="{:U('Shop/attributelist')}" class="btn btn-sm btn-default">商品类型</a>

    </div>
        <style type="text/css">
.spanfl span.checkbox {
	margin-top:10px;
}
</style>

<section class="panel-default m-b-sm">
                <div class="alert alert-info">
                    <p>
                      <i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
                    </p>
                    <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面可对商品分类添加修改操作。</p>
                    
                </div>
            </section>
        <form action="__CONTROLLER__/ticketTypeSave/" class="form form-horizontal" method="post" >
            <input type="hidden" name="id" value="{$current.id}" />
            <div class="search_box">
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="name">商品分类</label>
                    <div class="col-sm-9">
                        <input id="name" data="商品类型" name="name" value="{$current['name']}" datatype="required" class="col-xs-10 col-sm-2" type="text">
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="shortname">商品分类简称</label>
                    <div class="col-sm-9">
                        <input id="shortname"  name="shortname" value="{$current['shortname']}"  class="col-xs-10 col-sm-2" type="text">
                    </div>
                </div>

                 <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="shortname">seo关键词：</label>
                    <div class="col-sm-9">
                        <input id="shortname"  name="keywords" value="{$current['keywords']}"  class="col-xs-10 col-sm-5" type="text">
                    </div>
                </div>

                 <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="shortname">seo描述：</label>
                    <div class="col-sm-9">
                       <textarea name="description" cols="30" rows="10" style=" width: 41.66666666666667%;" >{$current['description']}</textarea>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="bid">上级分类</label>
                    <div class="col-sm-2">
                        <select name="bid" id="bid" class="width-80 form-control">
                            <option value="0" selected="">=请选择上级类型=</option>
                            <volist name="array" id="row">
                                <?PHP
				                        		$numFlag	=	count( explode(',',$row['bids']) )-1;
												$flag	=	'';
												for( $i = 0; $i < $numFlag; $i++ ){
													$flag	.=	'├─';
												}
	                        				?>
                                <option value="{$row.id}" <?PHP if( $row['id'] == $current['bid'] ){?>selected="selected"<?PHP } ?> <?PHP if( $_GET['tid'] == $row['id'] ){?>selected="selected"<?PHP } ?> >{$flag}{$row.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="bid">商品类型</label>
                    <div class="col-sm-2">
                        <select name="type_id" id="type_id" class="width-80 form-control">
                            <option value="0" selected="">请选择商品类型</option>
                            <volist name="shop_types" id="row">
                                <option value="{$row.id}" <?PHP if( $row['id'] == $current['type_id'] ){?>selected="selected"<?PHP } ?> >{$row.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" for="sort">优先级</label>
                    <div class="col-sm-9">
                        <input type="text" id="sort" datatype="required" data="优先级" name="sort" value="{$current['sort']|default='0'}" class="col-xs-10 col-sm-2" >
                    </div>
                </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label id="form-field-27" class="col-sm-1 control-label no-padding-right" for="isMobile">是否可见:</label>
                        <div class="col-sm-9">
                            <label class="switch">
                            <?php  if($current['ishidden']===null){?>
                                <input type="checkbox" name="ishidden" checked>
                            <?php  }else{?>
                                <input type="checkbox" name="ishidden" <eq name="current['ishidden']" value="0">checked</eq>>
                            <?php  }?>
                                
                                <span></span>
                            </label>
                        </div>
                    </div>
                <div class="space-4"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label no-padding-right" >绑定的品牌</label>
                    <div class="col-sm-9" style="height:300px; overflow:auto;">
                        <?PHP
				            			$bindArray	=	explode(',',$current['bindBrand']);
            						?>
                        <volist name="brandArray" id="row">
                            <?PHP
				            				$flag	=	'';
            								if( $bindArray ){
												foreach( $bindArray AS $key1=>$row1 ){
													if( $row1 == $row['id'] ){
														$flag		=	'checked';
													}else{
														continue;
													}
												}
											}


            							?>
                            <lable style=" margin-bottom:5px;" class="col-sm-3">
                                <input class="ace" type="checkbox" name="bindBrand[]" value="{$row.id}" <?=$flag?> />
                                <span class="lbl">{$row.name}</span></lable>
                        </volist>
                    </div>
                </div>
                
				
                <div class="space-4"></div>
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                       <input type="button" value="保存" ajax="1" id="form" class="btn btn-primary btn-sm formSubmit"> 
					    &nbsp; &nbsp; &nbsp;
                        <button class="btn btn-primary btn-sm btn-danger" type="button" onclick="history.back(-1);">取消</button>
                    </div>
                </div>
            </div>
            
        </form>
       
    </div>
</div>
<include file="Public:footer" />